<?php
namespace app\order\model;

use think\Model;
use think\Db;

class OrderModel extends Model
{
    public function addOrder($order)
    {
        $res = Db::name('order')->insert($order);
        return $res;
    }

    public function delOrder($ids)
    {
        $res = Db::name('order')->where('order_id', 'in', $ids)->delete();
        return $res;
    }

    public function upOrder($order)
    {
        $res = Db::name('order')->where('order_id', $order['order_id'])->update($order);
        return $res;
    }

    public function upOrderStatus($ids, $status)
    {
        $res = Db::name('order')->where('order_id', 'in', $ids)->update(['order_status' => $status]);
        return $res;
    }

    public function getOrder($order)
    {
        $res = Db::name('order')->where($order)->order('order_ctime desc')->select();
        return $res;
    }
}
